package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface NursingLevelMapper {
    /**
     * 分页查询护理等级
     * @param name 护理等级名称
     * @param status 护理等级状态
     * @return
     */
    Page<NursingLevelVo> getByPage(String name, Integer status);

    /**
     * 添加护理等级
     * @param nursingLevel 护理等级信息
     * @return
     */
    void addLevel(NursingLevel nursingLevel);

    /**
     * 删除护理等级
     * @param id 护理等级id
     * @return
     */
    @Delete("delete from nursing_level where id = #{id}")
    void deleteLevel(Long id);

    /**
     * 根据id查询护理等级信息
     * @param id 护理等级id
     * @return
     */
    NursingLevelVo getLevelById(Long id);

    /**
     * 修改护理等级信息
     * @param nursingLevel
     * @return
     */
    void updateLevel(NursingLevel nursingLevel);

    /**
     * 查询所有护理等级
     * @return
     */
    List<NursingLevelVo> getAllLevel();

    /**
     * 修改护理等级状态
     * @param id 护理等级id
     * @param status 护理等级状态
     * @return
     */
    @Update("update nursing_level set status = #{status} where id = #{id}")
    void updateStatus(Long id, Integer status);
}
